package com.dynamixsoftware.printershare.smb.netbios;

import java.io.IOException;
import java.io.InputStream;

public abstract class SessionServicePacket
{
  private static final int HEADER_LENGTH = 4;
  public static final int NEGATIVE_SESSION_RESPONSE = 131;
  public static final int POSITIVE_SESSION_RESPONSE = 130;
  static final int SESSION_REQUEST = 129;
  int length;
  int type;
  
  private int writeHeaderWireFormat(byte[] paramArrayOfByte, int paramInt)
  {
    int i = paramInt + 1;
    paramArrayOfByte[paramInt] = ((byte)this.type);
    if (this.length > 65535) {
      paramArrayOfByte[i] = 1;
    }
    int j = i + 1;
    writeInt2(this.length, paramArrayOfByte, j);
    return 4;
  }
  
  private static void writeInt2(int paramInt1, byte[] paramArrayOfByte, int paramInt2)
  {
    int i = paramInt2 + 1;
    paramArrayOfByte[paramInt2] = ((byte)(0xFF & paramInt1 >> 8));
    paramArrayOfByte[i] = ((byte)(paramInt1 & 0xFF));
  }
  
  abstract int readTrailerWireFormat(InputStream paramInputStream, byte[] paramArrayOfByte, int paramInt)
    throws IOException;
  
  abstract int writeTrailerWireFormat(byte[] paramArrayOfByte, int paramInt);
  
  public int writeWireFormat(byte[] paramArrayOfByte, int paramInt)
  {
    this.length = writeTrailerWireFormat(paramArrayOfByte, paramInt + 4);
    writeHeaderWireFormat(paramArrayOfByte, paramInt);
    return 4 + this.length;
  }
}


/* Location:           C:\Users\Admin\Desktop\Decompiler\JAD\jd-gui-0.3.6.windows\classes_dex2jar.jar
 * Qualified Name:     com.dynamixsoftware.printershare.smb.netbios.SessionServicePacket
 * JD-Core Version:    0.7.0.1
 */